package cn.huangsm.advance.redistolimit.config;

import cn.huangsm.advance.redistolimit.interceptor.AccessLimitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 配置拦截器
 *
 * @author huang
 * @PACKAGE_NAME cn.huangsm.advance.redistolimit.config
 * @PROJECT_NAME advance-code
 * @date 2019/1/19
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private AccessLimitInterceptor accessLimitInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(accessLimitInterceptor);
    }
}
